package com.zr.service.sys.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zr.dao.sys.SysLogDao;
import com.zr.service.sys.SysLogService;
import com.zr.vo.sys.SysLog;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/***
 * @author 王红伟
 * 登录日志 服务层实现
 */
@Service
public class SysLogServiceImpl implements SysLogService {
    @Resource
    private SysLogDao sysLogDao;

    /***
     * 按条件查询日志
     * @param sysLog
     * @return
     */
    @Override
    public PageInfo<SysLog> list(SysLog sysLog) {
        PageHelper.startPage(sysLog.getPageNum(), sysLog.getPageSize());
        return new PageInfo<>(sysLogDao.list(sysLog));
    }

    /***
     * 生成日志
     * @param sysLog
     * @return
     */
    @Override
    public int insert(SysLog sysLog) {
        return sysLogDao.insertSelective(sysLog);
    }
}
